<@pp.dropOutputFile/>
<#include "../common/util.ftl">

<#-- generate package name -->

<#-- iterate table list-->
<#list doc.tables as table>
<#assign module = doc.artifactid?replace(".", "/") + "/" + table.moduleid?uncap_first>
<#assign fileName = table.name?cap_first>
<#assign data_url = "/" + module + "/" + fileName + "/">
<@pp.changeOutputFile name="/main/webapp/" + module + "/" + fileName + "/showitems.ftl"/>
<#noparse>
<#compress>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<title></#noparse>${fileName}<#noparse> test!</title>
<#assign base="${request.getContextPath()}">
<#include "/common/import1_css.ftl">
<#include "/common/import1_js.ftl">
<script type="text/javascript"><#include "showitems_js.ftl"></script>
</head>

<body class="easyui-layout">
	<div region="north" class="noprint" style="height:60px;overflow:hidden;font-family:SimHei;">
		<div class="well" style="margin-bottom:0px;padding:10px;">
			<form id="search_form" class="form-inline">
				<div class="form-group">
					<div class="input-group">
						<div class="input-group-addon">ID</div>
						<input name="id" type="text" class="form-control" placeholder="ID...">
						<span class="input-group-btn">
							<button onClick="search()" class="btn btn-primary" type="button"><span class="glyphicon glyphicon-search"></span> 搜索</button>
						</span>
					</div>
				</div>
				<div class="form-group">
					<button onClick="showAdd()" class="btn btn-success" type="button"><span class="glyphicon glyphicon-plus"></span> 新增</a>
				</div>
				<div class="form-group">
					<button onClick="deleteItems()" class="btn btn-danger" type="button"><span class="glyphicon glyphicon-remove"></span> 删除</a>
				</div>
			</form>
		</div>
	</div>
	
	<div region="center">
		<table id="dataTable"></table>
	</div>

	<#-------------------------->
   <div id="addDialog" title="<span class='glyphicon glyphicon-plus'></span> 新增记录" class="easyui-dialog" style="width:380px;height:400px;padding:15px;" closed="true" modal="true" buttons="#dlg-add-buttons" data-options="closable:true">
	    <div class="container-fluid">
			<form id="addForm" class="form-horizontal" role="form" method="post">
				</#noparse>
				<#list table.fields as field>
				<div class="form-group">
					<div class="input-group">
						<div class="input-group-addon">${field.label}</div>
						<input type="${getHTML5type(field.type)}" name="obj.${field.name}" placeholder="${field.label}" class="form-control">
					</div>
				</div>
				</#list>
				<#noparse>
			</form>
		</div>
	</div>
    <div id="dlg-add-buttons">
    	<button id="add_button" type="button" onClick="add()" class="btn btn-success"><span class="glyphicon glyphicon-ok"></span> 保存</button>
    </div>

	<#-------------------------->
	<div id="editDialog" title="<span class='glyphicon glyphicon-plus'></span> 修改记录" class="easyui-dialog" style="width:380px;height:400px;padding:15px;" closed="true" modal="true" buttons="#dlg-edit-buttons" data-options="closable:true">
	    <div class="container-fluid">
			<form id="editForm" class="form-horizontal" role="form" method="post">
				<input type="hidden" name="obj.id">
				</#noparse>
				<#list table.fields as field>
				<#if field.name != "id">
				<div class="form-group">
					<div class="input-group">
						<div class="input-group-addon">${field.label}</div>
						<input type="${getHTML5type(field.type)}" name="obj.${field.name}" placeholder="${field.label}" class="form-control">
					</div>
				</div>
				</#if>
				</#list>
				<#noparse>
			</form>
		</div>
	</div>
    <div id="dlg-edit-buttons">
		<button id="update_button" type="button" onClick="update()" class="btn btn-success"><span class="glyphicon glyphicon-ok"></span> 保存</button>
    </div>

</body>
</html>
</#compress>
</body>
</html>
</#noparse>
</#list>